package com.lanzuo.yxd.scanner.config;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.List;

@Data
@Slf4j
@Component
@ConfigurationProperties(prefix = "lane")
public class LaneConfigList {
    private List<LaneConfig> configs;

    @PostConstruct
    public void print() {
        log.info("=== LaneConfigList loaded ===");
        log.info("Config list: {} ", configs);
        if (configs != null) {
            configs.forEach(c -> System.out.println("  Lane: " + c.getLaneNo() + ", scanners: " + c.getScanner()));
        }
    }
}